﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace Swin_e_mon_Forms
{
    public class Path: GameEntity
    {
        private Location toLocation;

        public Location ToLocation
        {
            get { return toLocation; }
            set { toLocation = value; }
        }

        public Path(string[] ids, Location loc)
            : base(ids, false)
        {
            this.toLocation = loc;
        }

        public string TakePath(Player p)
        {
            p.InLocation = ToLocation;
            return this.Description;
        }
    }

    [TestFixture]
    public class TestMovement
    {
        [Test]
        public void TestPathList()
        {
            Location aNewLoc = new Location(new string[] { "A Place" });
            Location aSecondNewLoc = new Location(new string[] { "A Second Place" });
            Path p1 = new Path(new string[] { "West" }, aSecondNewLoc);
            aNewLoc.paths.Add(p1);
            aSecondNewLoc.paths.Add(new Path(new string[] { "East" }, aNewLoc));

            p1.Description = " You walk through the door";

            Player p = new Player();
            p.InLocation = aNewLoc;

            String output = p.MoveVia("west");


            StringAssert.Contains(p1.Description, output);
            Assert.AreSame(aSecondNewLoc, p.InLocation);

            //         Assert.IsNull(aNewLoc.LocatePath("null"));\                string[] splitString = Description.Split('%');
       /*     if (splitString.Length > 0)
            {
                string tempDesc = "";
                foreach (string s in splitString)
                    tempDesc += s + "\n\n";

                return tempDesc + "\n\nInside the " + Title + " you can see:\n\n" + Inventory.ItemList; ;
            }  */
        }
    }
}
